package pizza3n;

/**
 * serial:1388
 */
class Test {
    public static void main(String[] args) {
        int[] slices = {1, 2, 3, 4, 5, 6};
        System.out.println(new Solution().maxSizeSlices(slices));
    }
}

class Solution {
    public int maxSizeSlices(int[] slices) {
        Node circular_list = new Node();
        circular_list.pre = circular_list.next = circular_list;

        for (int slice :
                slices) {
            Node temp = new Node(slice);
            temp.pre = circular_list;
            temp.next = circular_list.next;
            circular_list.next = temp;
        }

        System.out.println(circular_list);

        return 0;
    }
}

class Node {
    int val;
    Node pre;
    Node next;

    public Node() {
    }

    public Node(int val) {
        this.val = val;
    }

    public Node(int val, Node pre, Node next) {
        this.val = val;
        this.pre = pre;
        this.next = next;
    }

}